define(function (require, exports, module) {
    "require:nomunge,exports:nomunge,module:nomunge";
    var $ = require("jquery");

	var $news_page=$(".news_take_con"),
		$take_tab=$(".take_tab");

	$take_tab.find(".tab_info a").mouseenter(function(){
		var $this=$(this).parent("li");
			$index=$this.index();

			$this.addClass("cur").siblings().removeClass("cur").parent(".tab_info")
			.siblings('.tab_banner').children().eq($index).show().siblings().hide();
	});

	$news_page.find(".add").on("click",function(){
		var $this=$(this),
			$mzg_list=$this.closest('.mzg_list'),
			$text_box=$mzg_list.find(".text_box");
			num=parseInt($text_box.val())+1;
		$text_box.val(num);
	});

	$news_page.find(".min").on("click",function(){
		var $this=$(this),
			$mzg_list=$this.closest('.mzg_list'),
			$text_box=$mzg_list.find(".text_box");
			num=parseInt($text_box.val())-1;
		if(num==0){
			$text_box.val(1);
		}else{
			$text_box.val(num);
		}
	})

	var $trip_con=$(".village_travel_con");
		$trip_con.find(".subnav_tab").hover(function() {
			var $this=$(this);
				$ul_list=$(".subnav_list").closest($this).find(".subnav_list");
			$this.addClass('eur');
			$ul_list.show();

		}, function() {
			var $this=$(this);
				$ul_list=$(".subnav_list").closest($this).find(".subnav_list");
			$this.removeClass('eur');
			$ul_list.hide();
		});


	var $sort=$trip_con.find(".city_item:gt(10)");
	$sort.hide();
	var $sort_btn=$trip_con.find(".sele_ext");
	$sort_btn.on("click",function(){
		if($sort.is(":visible")){
			$sort.hide();
			$(this).css("background-position","0 -201px");
		}else{
			$sort.show();
			$(this).css("background-position","0 -250px");
		}
		return false;	
	});

	$trip_con.find(".select_item a").on("click",function(){
		var $trip_category=$(this).closest(".trip_category");
		$trip_category.find(".select_item a").removeClass('green');
		$(this).addClass('green');
	});

	var $view_inner=$trip_con.find(".view_inner").closest('.view_item');

	$('.view_item').hover(function(){
		var $this=$(this);
		$this.children($view_inner).addClass('bur');
	},function(){
		var $this=$(this);
		$this.children($view_inner).removeClass('bur');

	});

	$trip_con.find(".view_item:nth-child(3n)").css("margin-right","0");

// 下拉菜单
	var $search_box=$(".search_top_box"),
		$ul_lists=$search_box.find(".search_tag ul"),
		$select_js_sub=$search_box.find(".search_tag .select_js_sub");

	$select_js_sub.on("click",function(e){
		if($ul_lists.is(":visible")){
			$ul_lists.hide();
		}else{
			$ul_lists.show();
		}

		$(document).one("click",function(){
      	 	$ul_lists.hide();
   		});

	  	e.stopPropagation();
	});

	$ul_lists.on("click",function(e){
	    e.stopPropagation();
	});

});